import { airportList } from './service';
export default {
  namespace: 'airportDataModel',

  state: {
    data: [{ text: '范例1', id: 1 }],
  },

  effects: {
    *fetch({ payload }, { call, put }) {
      const data = yield call(airportList, payload);
      console.log(data);
      yield put({
        type: 'save',
        payload: { data },
      });
    },
  },

  reducers: {
    save(state, action) {
      return {
        ...state,
        ...action.payload,
      };
    },
  },
};
